import {doCustomTimes} from "@/libs/utils"
import Mock from 'mockjs';
const Random = Mock.Random

export const taskList = (req) =>{
    let taskList = [];
	doCustomTimes(5,()=>{
        taskList.push(Mock.mock({
            "id":Random.increment(4),
			"KKScode|1":["1KBF22CP001","1MAX51AE001","1KLE40AH013-M01","1BTG21","1KTT10AA108-M01"],
            "description|1":["检查维护(1M)","四年大修(4Y)","定期标定","11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水",""],        
			leader:"@cname",
		}));		
	})
	return {
		data:taskList,
		success: "true",
		msg: null
	}	
};

export const wrongList = (req)=>{
    let wrongList = [];
	doCustomTimes(5,()=>{
        wrongList.push(Mock.mock({
            "id":Random.increment(5),
			"KKScode|1":["1KBF22CP001","1MAX51AE001","1KLE40AH013-M01","1BTG21","1KTT10AA108-M01"],
            "description|1":["检查维护(1M)","四年大修(4Y)","定期标定","11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水",""],
			leader:"@cname",
		}));		
	})
	return {
		data:wrongList,
		success: "true",
		msg: null
	}	
}

export const taskInfo = (req)=>{
    let data = Mock.mock({
        KKScode:"uiu",
        "description|1":["检查维护(1M)","四年大修(4Y)","定期标定","11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水",""],
        "location|1":["一楼","二楼","三楼"],
        deadLine:"@date",
        leader:"@cname",
        wrongStaff:false,
        completed:false,
        "progress|1":["西门子分析可能原因为顺控开主汽门脉冲时间偏小。","需要进行解体大修。",""]
    });
    return {
		data:data,
		success: "true",
		msg: null
	}	
}

export const wrongInfo = (req)=>{
    let data = Mock.mock({
        KKScode:"uiu",
        "description|1":["检查维护(1M)","四年大修(4Y)","定期标定","11UCB厂房27米电梯右侧1GKC管道上有砂眼喷水",""],
        "location|1":["一楼","二楼","三楼"],
        deadLine:"@date",
        leader:"@cname",
        wrongStaff:false,
        completed:false,
        "progress|1":["西门子分析可能原因为顺控开主汽门脉冲时间偏小。","需要进行解体大修。",""]
    });
    return {
		data:data,
		success: "true",
		msg: null
	}	
}

export const markReply = {
    data: "",
    success: "true",
    msg:"保存成功!"
}

export const getLeaderList = () => {
    let leaderList = [];
    doCustomTimes(10, () => {
      leaderList.push(Mock.mock('@cname'))
    })
    return {
        data: leaderList, 
        success: "true",
        msg:null
    }
  }

  export const getStaffList = () => {
    let staffList = [];
    doCustomTimes(50, () => {
        staffList.push(Mock.mock('@cname'))
    })
    return {
        data: staffList, 
        success: "true",
        msg:null
    }
  }


  
export const modifyLeader = {
    data: "",
    success: "true",
    msg:"保存成功!"
}